<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	div,p,input{
		border: solid 1px red;
	}
</style>
<script type="text/javascript">
	function(){
		//通过事件源来区分
		var obj=event.target || event.srcElement;
		//得到事件源的元素名
		alert(obj.nodeName);
	}
</script>
</head>
<body>
 <div onclick="myfn()">
 	<p onclick="alert('p')">
 		<input type="button" value="按钮" onclick ="alert('按钮')">
 	</p>
 </div>
</body>
</html>